﻿<Window x:Class="RequirementLogger.Appl.Views.frmMain"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:VM="clr-namespace:RequirementLogger.Appl.ViewModels"
        Height="350" Width="525">

    <Grid Name="LayoutRoot">
        <Grid Name="grdDefaultLayout" Margin="10">
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.Resources>
                <VM:MainViewModel x:Key="MainVM" />
            </Grid.Resources>

            <StackPanel Name="stkApps" Orientation="Vertical" Margin="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                <TextBlock Name="lblApps" Text="Select application.." Margin="0,0,0,3" />
                <Grid Name="grdEditApps">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Name="colEdit" Width="65" />
                        <ColumnDefinition Name="colClear" Width="30" />
                    </Grid.ColumnDefinitions>
                    <ComboBox Name="cmbAppNames" Margin="0,0,3,0" DataContext="{StaticResource MainVM}" 
                               ItemsSource="{Binding AllApplications}" 
                               SelectedItem="{Binding SelectedApp}"
                               DisplayMemberPath="AppName" SelectedValuePath="AppId" />
                    <ToggleButton Name="btnEdit" Grid.Column="1" Content="Edit/Add" HorizontalAlignment="Right" 
                                  DataContext="{StaticResource MainVM}" IsChecked="{Binding EditClicked, Mode=TwoWay}" />
                    <ToggleButton Name="btnClear" Grid.Column="2" Content="X" Foreground="Red" FontWeight="Bold" 
                                  HorizontalAlignment="Right" 
                                  DataContext="{StaticResource MainVM}" IsChecked="{Binding ClearClicked, Mode=TwoWay}" />
                </Grid>
            </StackPanel>
        </Grid>
    </Grid>
</Window>
